package qc.module.demo.mapper;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import qc.module.demo.dto.rsvr.RSVRDto;
import qc.module.demo.entity.RSVR;

import java.util.List;

/**
 * RSVRMapper
 *
 * @author QuCheng Tech
 * @since 2023/9/19
 */
@Mapper
public interface RSVRMapper {
    RSVRMapper MAPPER = Mappers.getMapper(RSVRMapper.class);

    @Mapping(target = "TM", ignore = true)
    RSVR toEntity(RSVRDto dto);

    @Mapping(target = "TM", source = "TM", dateFormat = "yyyy-MM-dd HH:mm:ss")
    RSVRDto toDto(RSVR en);

    List<RSVRDto> toDtoList(List<RSVR> enList);
}
